<?php
/**
 * @version SVN: $Id: stuffer_packageelements.php 1221 2010-05-31 19:00:50Z elkuku $
 * @package    EasyCreator
 * @subpackage Views
 * @author     EasyJoomla {@link http://www.easy-joomla.org Easy-Joomla.org}
 * @author     Nikolai Plath {@link http://www.nik-it.de}
 * @author     Created on 30-May-2010
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */

//-- No direct access
defined('_JEXEC') or die('=;)');

$projects = EasyProjectHelper::getProjectList();
$projectTypes = EasyProjectHelper::getProjectTypes();

echo ecrHTML::floatBoxStart();
?>
<div class="infoHeader imgbarleft icon-24-package_creation"><?php echo JText::_('Package elements') ?></div>
<?php
foreach ($projectTypes as $comType => $display)
{
    if($comType == 'package') continue;

    if(isset($projects[$comType])
    && count($projects[$comType]))
    {
        $class = ' class="img12 icon-12-'.$comType.'"';
        echo '<div'.$class.'>'.$display.'</div>';

        foreach($projects[$comType] as $project)
        {
            $id = 'pkgelements_'.$project->fileName;
           $checked =(in_array($project->fileName, $this->project->elements)) ? ' checked="checked"' : '';
           echo '<input type="checkbox" name="package_elements[]" value="'.$project->fileName.'" id="'.$id.'"'.$checked.' />';
            echo NL.'<label for="'.$id.'"'.$class.'>'.$project->name.'</label>';
            echo BR;
        }//foreach
    }
}//foreach

echo ecrHTML::floatBoxEnd();
